<template>
  <!-- 主诉 -->
  <el-popover :disabled="disabled" placement="bottom-start" :width="width" trigger="focus">
    <div slot="reference">
      <slot></slot>
    </div>
    <el-tag v-for="(item,index) in tableList" :key="index" @click="onClickData(item)" style="margin:0 10px 10px 0;cursor: pointer;">{{item.desc}}</el-tag>
  </el-popover>
</template>
<script>
export default {
  components: {
  },
  props: {
    width: {
      default: 600,
      type: Number
    },
    disabled: {
      default: true,
      type: Boolean
    }
  },
  data() {
    return {
      tableList: []
    };
  },
  mounted() {
    let th = this;
    
    th.getCommonConfigByKey("主诉").then(res => {
      th.tableList = res;
    });
  },
  methods: {
    onClickData(obj) {
      let th = this;
      th.$emit("update", obj.desc);
    }
  }
};
</script>